

<script>
import CartItem from './CartItem.vue';
import Total from './Total.vue';
export default {
  name: 'shopping cart',
  props: {
    items: {
        type: Array,
        required: true
    }
  },
  components: {
    CartItem,
    Total
  }
}
</script>

<template>
    <div class="shopping-cart">
        <h3>购物车</h3>
        <CartItem v-for="(item, index) in items" 
                  v-bind="item"
                  :ordinal="index+1"
                  :key="item.id"></CartItem>
        <Total></Total>
    </div>
</template>

<style>
</style>